<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
     <%@ include file="/WEB-INF/views/include/taglib.jsp"%>
     <!DOCTYPE html>
<html>
	<head>
		<meta name="decorator" content="common" />
		<script>
		  $(function(){
		    var status=$("#status").val();
			 if(status==1){
				 $("#step").find('li').eq(0).addClass("step_yellow");
			 }else{
				 $("#step").find('li').eq(0).removeClass("step_yellow");
				 $("#fan2").hide();
				 $("#fan3").hide();
			 }
			if(status==2){
				$("#fan2").hide();
				 $("#fan3").hide();
				 $("#step").find('li').eq(1).addClass("step_yellow");
			 }else{
				 $("#step").find('li').eq(1).removeClass("step_yellow");
			 }
				 
			if(status==3){
				 $("#step").find('li').eq(2).addClass("step_yellow");
			 }else{
				 $("#step").find('li').eq(2).removeClass("step_yellow");
			 }
			
			if(status==4){
				 $("#step").find('li').eq(3).addClass("step_yellow");
			 }else{
				 $("#step").find('li').eq(3).removeClass("step_yellow");
			 }
			
			if(status==5){
				 $("#step").find('li').eq(4).addClass("step_yellow");
			 }else{
				 $("#step").find('li').eq(4).removeClass("step_yellow");
			 }
		  })
		  
		  $(function(){
	        $(".red_detail").click(function(){
			$("#proment_chose_fpdetail").show();	
		  });
		 $(".close_page").click(function(){
			$("#proment_chose_fpdetail").hide();
		 });
	})
		
	   function cancelShow(v){
			$(".user").show();
			$("#idsss").val(v);  
			  
		  }
		  
	  function cancelSave(){
		  var id=$("#idsss").val();
		  $(".user").hide();
		  window.location.href="${ctxWeb}/order/cancelOrder?orderId="+id
	  }
	  
	  function cancelHide(){
		  $(".user").hide();
	  }
		</script>
	</head>
	<body class="bg_gry">
	<input id="idsss" name="id" type="hidden"/>
	<!--订单详情-->
	<section>
		<div class="container">
			<div class="row">
				<div class="nav_title">
					<a href="javascript:void(0)">个人中心</a>>
					<a href="javascript:void(0)">我的订单</a>>
					<a href="javascript:void(0)">订单详情</a>
				</div>
				<div class="detail_bg_box">
					<!--进度条-->					
					<div class="detail_step mar_16 clearfix">
						<ul class="clearfix" id="step">
							<li>
								<p class="step_2">提交订单</p>
							</li>
							<li>
								<p class="step_2">付款</p>
							</li>
							<li>
								<p class="step_2">部分发货</p>
							</li>
							<li>
								<p class="step_2">全部发货</p>
							</li>
							<li>
								<p class="step_2">确认收货</p>
							</li>
						</ul>
					</div>
					<!--进度条结束-->
					<input name="status" value="${state}" type="hidden" id="status"/>
					<!--订单信息-->
					<div class="goods_detail_info_box mar_16 clearfix">
						<h3><span>订单信息</span></h3>
						<h4>
							<span class="ph_block">下单时间：<fmt:formatDate value="${createDate}" pattern="yyyy-MM-dd HH:mm"/></span>
							<span>订单编号：${ordersCode}</span>
							<span class="pay_status">${fns:getDictLabel(state, 'orders_state', '')}</span>
						</h4>
						<!--表格信息-->
						<div class="detail_table table-responsive">
							<table class="table table-bordered">
								<thead>
								    <tr>
								      <th>商品名称</th>
								      <th>配件编号</th>
								      <th>卖家</th>
								      <th>单价</th>
								      <th>数量</th>
								      <th>小计</th>
								      <th>已发货</th>
								    </tr>
								</thead>
								<tbody>
								   <c:forEach var="list" items="${list }">
								    <tr>
								      <td>${list.goodsCnName }</td>
								      <td>${list.partsCode }</td>
								      <td>${fns:getDictLabel(list.storeType, 'store_type', '')}：${list.storeName }</td>
								      <td>¥${list.price }</td>
								      <td>${list.num}</td>
								      <td>¥${list.totalMoney}</td>
								      <td>${list.fhNum}</td>
								    </tr>
								    </c:forEach>
								</tbody>
							</table>
						</div>
						<!--表格信息结束-->
						<div class="detail_infomation">
							<p>商品金额：¥<span >${goodsMoney}</span></p>
							<c:if test="${orders.freight!=null and  orders.freight!=''}">
							<c:if test="${orders.freight=='0.00'}">
								<p>运费：<span >到付</span></p>
							</c:if>
						   <c:if test="${orders.freight!='0.00'}">
								<p>运费：<span >￥${orders.freight }</span></p>
							</c:if>
							</c:if>
							<c:if test="${orders.freight==null or orders.freight==''}">
							<p>运费：<span >￥0.00</span></p>
							</c:if>
							<p class="color_red">总计：¥<span>${orders.freight+orders.money}</span></p>
						</div>
						<div class="pay_btn_staut">
						    <a href="javascript:history.go(-1)" class="bg_red_btn" id="fan1">返回</a>
							<a href="javascript:void(0)" class="bor_red_btn" id="fan2" onclick="cancelShow(${id})">取消订单</a>
							<a href="${ctxWeb}/payment/goPaymentShow?orderCode=${ordersCode}" class="bg_red_btn" id="fan3">去付款</a>
							<c:if test="${orders.state!=1 and orders.state!=2 and orders.state!=6 }">
								<a href="${ctxWeb}/order/logisticsSelect?orderCode=${ordersCode}" class="bg_red_btn" id="fan4">物流追踪</a>
							</c:if>
						</div>
					</div>
					<!--订单信息结束-->
					<!--其他信息-->
					<div class="goods_detail_info_box mar_16 clearfix">
						<h3><span>其他信息</span></h3>
						<div class="other_infomation clearfix">
							<figure class="col-xs-12 col-sm-6 col-md-3">
								<div class="other_infomation_item">
									<h5>收货人信息</h5>
									<div class="other_infomation_item_info ">
										<p class="clearfix">
											<em>收货人：</em>
											<span>${orders.receiveName }</span>
										</p>
										<p class="clearfix">
											<em>电话：</em>
											<span>${orders.receivePhone }</span>
										</p>
										<p class="clearfix item_address">
											<em>地址：</em>
											<span>${orders.receiveAddress }</span>
										</p>
									</div>
								</div>
								
							</figure>
							<figure class="col-xs-12 col-sm-6 col-md-3">
								<div class="other_infomation_item">
									<h5>配送信息</h5>
									<div class="other_infomation_item_info ">
										<p class="clearfix">
											<em>物流方式：</em>
											<span>${fns:getDictLabel(orders.transportType, 'transport_type', '')}</span>
										</p>
									</div>
								</div>
							</figure>
							<figure class="col-xs-12 col-sm-6 col-md-3">
								<div class="other_infomation_item">
									<h5>付款信息</h5>
									<div class="other_infomation_item_info ">
										<p class="clearfix">
											<em>付款方式：</em>
											<span>${fns:getDictLabel(orders.payType, 'pay_type', '')}</span>
										</p>
										<p class="clearfix">
											<em>商品金额：</em>
											<span>¥${orders.money}</span>
										</p>
										<p class="clearfix">
											<em>运费：</em>
											<span>
											<c:if test="${orders.freight==null or orders.freight==''}">
											 ¥0.00
											</c:if>
											<c:if test="${orders.freight!=null and orders.freight!=''}">
											 ¥${orders.freight}
											</c:if>
											</span>
										</p>
										<p class="clearfix">
											<em>订单总额：</em>
											<span>¥${orders.freight+orders.money}</span>
										</p>
									</div>
								</div>
								
							</figure>
							<c:if test="${webInvoiceInfo!=null }">
							<figure class="col-xs-12 col-sm-6 col-md-3">
								<div class="other_infomation_item">
									<h5>发票信息<a href="javascript:void(0)" class="red_detail">详情</a></h5>
									<div class="other_infomation_item_info ">
										<p class="clearfix">
											<em>发票类型:</em>
											<span>${fns:getDictLabel(webInvoiceInfo.invoiceType, 'invoice_type', '')}</span>
										</p>
											<c:choose>
												<c:when test="${not empty webInvoiceInfo.company }">
													<p class="clearfix item_name_company">
														<em>公司名称：</em>
														<span>${webInvoiceInfo.company }</span>
													</p>
													<p class="clearfix item_number">
														<em>纳税人识别号：</em>
														<span>${webInvoiceInfo.dutyCode }</span>
													</p>
												</c:when>
												<c:otherwise>
													 <p class="clearfix item_name_company">
														<em>发票抬头：</em>
														<span>${webInvoiceInfo.invoiceTitle }</span>
													</p> 
												</c:otherwise>
											</c:choose>
									</div>
								</div>
							</figure>
							</c:if>
						</div>
					</div>
					<!--其他信息结束-->
				</div>
			</div>
		</div>
	</section>
	<!--发票详情弹框-->
	<div class="jd_tk" id="proment_chose_fpdetail" style="display: none;">
		<div class="address_Bomb">
			<h3 class="address_Bomb_title">
				发票详情
				<span class="close_page">
					<img src="${ctxWebStatic }/images/close.png" alt="" />
				</span>
			</h3>
			<div class="chose_set_box fp_bomb_detail">
				<div class="chose_address_info address_Bomb_info  clearfix">
					<figure class="Settlement_address_msg">
						<p><em>发票类型：</em><span>${fns:getDictLabel(webInvoiceInfo.invoiceType, 'invoice_type', '')}</span></p>
						<c:choose>
						<c:when test="${webInvoiceInfo.invoiceType==2 }">
							<c:choose>
							<c:when test="${not empty webInvoiceInfo.company}">
								<%-- <p><em>发票抬头  ：</em><span>${webInvoiceInfo.company }</span></p> --%>
								<p><em>公司名称 ：</em><span>${webInvoiceInfo.company }</span></p>
								<p><em>纳税人识别号  ：</em><span>${webInvoiceInfo.dutyCode }</span></p>
							</c:when>
							<c:otherwise>
								<p><em>发票抬头  ：</em><span>${webInvoiceInfo.invoiceTitle }</span></p>
							</c:otherwise>
							</c:choose>
						</c:when>
						<c:otherwise>
								<%-- <p><em>发票抬头  ：</em><span>${webInvoiceInfo.company }</span></p> --%>
								<p><em>开票地址  ：</em><span>${webInvoiceInfo.address }</span></p>
								<p><em>账户  ：</em><span>${webInvoiceInfo.account }</span></p>
								<p><em>开户行  ：</em><span>${webInvoiceInfo.blank }</span></p>
								<p><em>纳税人识别号  ：</em><span>${webInvoiceInfo.dutyCode }</span></p>
						</c:otherwise>
						</c:choose>
						<p>
							<em>发票地址：</em>
							<span>${webInvoiceInfo.receiveName}</span>
							<span>${webInvoiceInfo.receivePhone}</span>
							<span>${webInvoiceInfo.receiveAddress}</span>
						</p>
					</figure>
				</div>
				
			</div>
		
		</div>
	</div>
	
	<!--弹框-->
		<div class="jd_tk user " id="del_tk" style="display: none;">
		    <div class="delet_box">
		        <div class="jd_win_tit">确定取消该订单？</div>
		        <div class="jd_btn clearfix">
		            <a href="javascript:void(0)" class="cancle" onclick="cancelHide()">取消</a>
		            <a href="javascript:void(0)" class="submit" onclick="cancelSave()">确定</a>
		        </div>
		
		    </div>
		</div>
	<!--弹框结束-->
	<!--发票详情弹框结束-->
	</body>
</html>
